package com.secondhand.project.mapper;

import com.secondhand.project.domain.Comment;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentMapper {
    Comment selectCommentById(Long id);

    List<Comment> selectCommentList(Comment comment);

    int insertComment(Comment comment);

    int updateComment(Comment comment);

    int deleteCommentById(Long id);

    int deleteCommentByIds(Long[] ids);


    List<Comment> selectRoot(Comment comment);

    List<Comment> selectByRootId(Long rootId);

    @Select("select count(*) from comment where fid = #{fid} and module = #{module}")
    Long selectCount(Comment comment);

    @Select("select * from comment where pid = #{pid}")
    List<Comment> selectByPid(Long pid);
}
